﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="MemberTypeAttribute.cs" company="CodePlex">
//   The MIT License
//   Copyright (c) 2013 Julien Blin
//   
//   Permission is hereby granted, free of charge, to any person obtaining a copy
//   of this software and associated documentation files (the "Software"), to deal
//   in the Software without restriction, including without limitation the rights
//   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//   copies of the Software, and to permit persons to whom the Software is
//   furnished to do so, subject to the following conditions:
//   
//   The above copyright notice and this permission notice shall be included in
//   all copies or substantial portions of the Software.
//   
//   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//   THE SOFTWARE.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace UCodeFirst.MemberTypes
{
    using System;
    using System.Diagnostics.CodeAnalysis;

    /// <summary>
    /// Allows the definition of member types attributes.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
    public class MemberTypeAttribute : NameAttributeBase
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="MemberTypeAttribute"/> class.
        /// </summary>
        public MemberTypeAttribute()
        {
            this.Icon = DefaultValues.Icon;
            this.Thumbnail = DefaultValues.Thumbnail;
            this.Description = DefaultValues.Description;
        }

        /// <summary>
        /// Gets or sets the icon. Default is member.gif
        /// </summary>
        public string Icon { get; set; }

        /// <summary>
        /// Gets or sets the thumbnail. Default is member.png
        /// </summary>
        public string Thumbnail { get; set; }

        /// <summary>
        /// Gets or sets the description.
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// Holds default values.
        /// </summary>
        public static class DefaultValues
        {
            /// <summary>
            /// member.gif
            /// </summary>
            [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1630:DocumentationTextMustContainWhitespace", Justification = "Reviewed. Suppression is OK here.")]
            public const string Icon = @"member.gif";

            /// <summary>
            /// member.png
            /// </summary>
            [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1630:DocumentationTextMustContainWhitespace", Justification = "Reviewed. Suppression is OK here.")]
            public const string Thumbnail = @"member.png";

            /// <summary>
            /// Empty string.
            /// </summary>
            public const string Description = @"";

            /// <summary>
            /// Name of the Generic properties tab (default and standard Umbraco tab which exists in every DocumentType)
            /// </summary>
            public const string TabGenericProperties = "Generic Properties";
        }
    }
}
